<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.7/iconfont.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="lib/daterangepicker/daterangepicker.css" /> 
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>订单详情</title>
<style type="text/css">


</style>
</head>
<body>
<div class="pd-20" id="detail">
	<script id="test" type="text/html">
	<table class="table table-border table-bordered table-bg table-sort">
		<thead>
			<tr class="text-c">
				<th class="text-l">
					<span class="pr-20">订单编号:<%=list.order_number%>(ID:<%=list.idle_order_id%>)</span>
					<span class="pr-20">订单时间:<%=list.order_time%></span>
					
					<span class="pr-20">订单金额:<%=list.total_quan%>券 <%=list.total_price%> (运费：<%=list.total_transport%>)</span>


					<span class="pr-20" style="float: right">
						<span class="pr-20" title="<%=list.cancel_reason%>">
							订单状态:
							
							<label style="color:#f37b1d;"><%=list.order_state_cn%></label>
							
						</span>


						
						
					</span>
				</th>
			</tr>

		</thead>
		<tbody id="content_sp">
			<tr class="text-l va-m" >
				<td>
					<div>
						
						<p><b>联系人：</b><%=list.receiver%> (<%=list.uid%>)</p>
						

						
									
					</div>
					<div>
						<table class="table table-border table-bordered table-bg table-sort">
							<thead>
								<tr class="text-c sort0">
									<th width="40" class="valueid"><input name="" type="checkbox" value=""></th>
									<th width="60">商品ID</th>

									<th>商品名称</th>
									<th width="80">缩略图</th>

									<th width="80">价格</th>
									<th width="120">订单时间</th>
									<th width="60">状态</th>
									<!-- <th width="100">操作</th> -->
								</tr>
							</thead>
							<tbody id="goodslist">
								
								<tr class="text-c sort1">
									<td class="valueid"><input name="" type="checkbox" value="<%=list.goods_id%>" <%if(list.order_state!=='101'){%> disabled <%}%>></td>
									<td class=""><%=list.idle_id%></td>
									<td class="text-l ">
										<%=list.goods_name%>
									</td>
									<td><img class="pic-thumb" src="<%=list.goods_image%>"></td>
									<td class="text-l ">金额：<%=list.total_cost%><br>运费：<%=list.total_transport%><br>抵扣券：<%=list.total_quan%><br></td>
									<td class="text-l "><%=list.order_time%></td>
									<td class="g-status"><%=list.order_state_cn%>
										
										<%if(list.order_state==20 || list.order_state==10 || list.order_state==100){ %>
											<span style="cursor: pointer;" class="label radius label-warning fun-refund" data-orderid="<%=list.idle_order_id%>">退款</span>			
										<%}%>
									</td>
									<!-- <td class="td-manage f-18">
										
 											<span class="label radius label-success fun-admin-refund" data-id="<%=list.goods_id%>" style="cursor: pointer;">退款</span>
 										
									</td> -->
								</tr>
								
							</tbody>
						</table>
						<div class="cl pd-5 bg-1 bk-gray mt-10"> 
							
							<!-- <a href="javascript:;" class="btn btn-warning l mr-10 mt-5 radius fun-admin-allrefund"><i class="Hui-iconfont">&#xe6de;</i> 批量退款</a>  -->
							
						</div>
					</div>
					<div>
						<p><b>其他信息</b></p>
						<p><b>formid</b><%=list.formid%> </p>
						<p style="max-width: 800px;"><b>payment</b><%=list.payment%></p>
						<p><b>prepay_id：</b><%=list.prepay_id%></p>
						<p><b>quan_detail：</b><%=list.quan_detail%></p>
				
						
						
						<p style="border-top:#333 1px dashed;border-bottom:#333 1px dashed"><b>支付信息</b></p>
						<p><b>支付时间：</b><%=list.pay_time%></p>
						<p><b>支付方式：</b><%=list.pay_type%></p>	
						<p style="cursor: pointer; font-weight: bold;" onclick="_open('支付详情','xianzhi-order-pay-detail.html?oid=<%=list.idle_order_id%>&reason=<%=list.cancel_reason%>','80%','70%',false)">查看支付详情>></p>
						
						<p style="border-top:#333 1px dashed;border-bottom:#333 1px dashed"><b>退款信息</b></p>
						<p><b>退款金额：</b><%=list.refund_fee%></p>
						<p><b>退券：</b><%=list.refund_quan%></p>
						<p><b>退款原因：</b><%=list.cancel_reason%></p>
						
						
						<p style="cursor: pointer; font-weight: bold;" onclick="_open('退款详情','xianzhi-order-refund-detail.html?oid=<%=list.idle_order_id%>&reason=<%=list.cancel_reason%>','80%','70%',false)">查看退款详情>></p>
					</div>
					
				</td>
			</tr>
		</tbody>
	</table>
	<div class="cl pd-5 bg-1 bk-gray mt-10 text-r"> 
		<div style="float: right;">
			<a class="btn btn-primary radius mt-5 l mr-10" data-title="添加内容" href="javascript:;" onclick="_open('打印订单','order-paper-print.html?oid=<%=list.order_id%>','90%','90%',false)" href="javascript:;">
				<i class="Hui-iconfont">&#xe652;</i> 打印
			</a>
			

			
		</div>
	</div>
	</script>
</div>





<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="js/H-ui.js"></script>
<script type="text/javascript" src="lib/layer/2.1/layer.js"></script> 
<script type="text/javascript" src="js/H-ui.admin.js"></script> 
<script type="text/javascript" src="js/template-native.js"></script> 
<script type="text/javascript" src="js/s.js"></script> 
<script type="text/javascript" src="lib/laypage/laypage.js"></script> 
<script type="text/javascript" src="lib/daterangepicker/moment.min.js"></script> 
<script type="text/javascript" src="lib/daterangepicker/jquery.daterangepicker.js"></script>
<script src="/Manage/js/lazyload.min.js"></script>
<script type="text/javascript">
var API=API_XIANZHIORDER;
var kk;

var oid=getUrlParam('oid');//编辑菜单id
$.getJSON(API+'?id='+oid,function(data){

	if(!checkStatus(data)) return;//判断登录

	if(data.datas==''){
		layer.msg("数据加载错误", {icon:2,time:1000});
	}else{
		var data={'list':data.datas};
        var html=template('test',data);
        $("#detail").html(html);

        //全选按钮

        $(".sort0 .valueid input:checkbox").on("click" , function(){
            $(this).closest("table").find(".valueid input:checkbox:not(:disabled)").prop("checked",$(this).prop("checked"));
        });
        // 取消全选
        $(document).on('click','.sort1 .valueid input:checkbox',function(){
            // 展开子分类
            $(this).parent().parent().nextUntil('.sort1').find('.valueid input:checkbox:not(:disabled)').prop("checked",$(this).prop("checked"));
            var checklen1=$(".sort1 .valueid input:checkbox:checked:not(:disabled)").length;
            var len1=$(".sort1 .valueid input:checkbox:not(:disabled)").length;
            $(".sort0 input:checkbox:not(:disabled)").prop("checked",checklen1==len1);//全选按钮
        })

        // 退款
        $(document).on('click','span.fun-refund',function(){
        	var flag=$(this).data("flag");
        	var oid=$(this).data("orderid");
        	console.log(oid);
        	var that=$(this);
        	layer.confirm('退款后,券和运费将打到用户账户?',function(index){
        		layer.close(index);
                
                $.post(API_XIANZHIORDER_REFUND,{
                	oid:oid,
                	type:'refund',
                },function(data){
                	// data=eval("( "+data+" )");
                	if(!checkStatus(data)) return;
                	
                	that.parent().html("已退款√")

        		    
                },'json')
            })
        	
        })
	}
})




</script>

</body>
</html>